﻿<%--<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Models.TrainingsRequestsExt>" %>--%>
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.TrainingsRequestsExt>" %>

<%
    var leCol = new CRM.Database.Model.LegalEntitiesCollection();
    if (Model.Request.IdCustomer != null)
        Html.DevExpress().ComboBox(settings =>
                                       {
                                           settings.Name = "IdLegalEntity";
                                           settings.CallbackRouteValues = new { Controller = "TC", Action = "TrainingsRequestLEPartial", key = Model.Key };
                                           settings.Properties.ValueType = typeof(int);
                                           settings.Properties.TextField = "Name";
                                           settings.Width = 496;
                                           settings.Properties.ValueField = "IdLegalEntity";
                                           settings.Properties.EnableCallbackMode = true;
                                           settings.Properties.ClientSideEvents.SelectedIndexChanged = "function(s, e) { IdContact.PerformCallback();  }";
                                       //}).BindList(DB.GetCustomerById((int)Model.Request.IdCustomer).LegalEntities).Bind(Model.IdLegalEntity).GetHtml();
                                       }).BindList(leCol.GetFullDefinedLegalEntitiesByCustomerId((int)Model.Request.IdCustomer)).Bind(Model.IdLegalEntity).GetHtml();
                                       //}).BindList(DB.GetFullDefinedLegalEntitiesByCustomerId((int)Model.Request.IdCustomer)).Bind(Model.IdLegalEntity).GetHtml();
%>